import request from '@/utils/request'
import { otherFiltersItem } from '@/utils'

// 保存门店选址
export function saveAddress(data) {
  return request({
    url: data.id ? '/api/v1/shopLocationEval/update' : '/api/v1/shopLocationEval/insert',
    method: data.id ? 'post' : 'put',
    data
  })
}

// 保存档案维护
export function saveFileMaintain(data) {
  return request({
    url: '/api/v1/shopLocationEval/updateState',
    method: 'post',
    data
  })
}
// 根据id查询
export function getDetailById(id) {
  return request({
    url: `/api/v1/shopLocationEval/${id}`,
    method: 'get'
  })
}
/**
 * 根据所属模块获取文件列表
 * @returns
 */
export function postConfigAttachmentTemplate() {
  const data = new FormData()
  data.append('filtersRaw', JSON.stringify([otherFiltersItem('belongModel', 'LOCATION_EVAL', '=')]))
  return request({
    url: '/api/v1/configAttachmentTemplate/page',
    method: 'POST',
    data
  })
}
// 批量终止数据
export function terminalSelect(data) {
  return request({
    url: '/api/v1/shopLocationEval/batchStop',
    method: 'post',
    data
  })
}
// 批量提交数据
export function submitSelect(data) {
  return request({
    url: '/api/v1/shopLocationEval/batchSubmit',
    method: 'post',
    data
  })
}
// 审核
export function saveAudit(data) {
  return request({
    url: '/api/v1/shopLocationEval/updateState',
    method: 'post',
    data
  })
}

